package com.xjrsoft.module.demo.rabbitmq;

import com.xjrsoft.module.demo.entity.XjrBaseItem;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class MyRabbitMQProvide {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void testProvider(){
        XjrBaseItem item = new XjrBaseItem();
        item.setCount(1);
        item.setName("test");
        item.setDeposition("test");
        amqpTemplate.convertAndSend("test",item);
    }
}
